﻿using Microsoft.AspNetCore.Mvc.Filters;
using System;

namespace DemoMVC.Filters
{
    public class SystemExceptionFilter : Attribute, IExceptionFilter
    {
        /// <summary>
        /// 异常处理函数
        /// </summary>
        /// <param name="context"></param>
        /// <exception cref="NotImplementedException"></exception>
        public void OnException(ExceptionContext context)
        {

            var controllerName = context.RouteData.Values["controller"];
            var actionName = context.RouteData.Values["action"];
            Console.WriteLine(controllerName + " " + actionName + " " + "error...");
            throw new NotImplementedException();
        }
    }
}
